import worker from '@ohos.worker';
import serialPort from "libserialport.so";
import Logger from '../model/Logger';

const TAG = '[IdoUart-worker]'
const parentPort = worker.parentPort;

parentPort.onmessageerror = function (e) {
  let data = e.data
  Logger.info(TAG, `onmessageerror:` + data);
}

parentPort.onmessage = function(e) {
    let data = e.data;
    parentPort.postMessage(data);
    //Logger.info(TAG, `worker send msg:` + data);
}
